package com.jiangcheng.demo.controller;


import com.jiangcheng.demo.entity.Reply;
import com.jiangcheng.demo.service.ReplyService;
import com.jiangcheng.demo.utils.NewResult;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author admin
 * @since 2021-07-26
 */
@Api("回复相关API")
@RestController
@RequestMapping("/reply")
public class ReplyController {
    @Autowired
    ReplyService replyService;

    @GetMapping("/replys/{comment_id}/{u_id}")
    public NewResult findReply(@PathVariable("comment_id") int commentId,@PathVariable("u_id") int uId){
        return replyService.findReplyByCommentId(commentId,uId);
    }
    @PostMapping("/addReply")
    public NewResult insertReply(Reply reply){
        return replyService.insertReply(reply);
    }

}

